<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableActivity extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity', function (Blueprint $table) {
            $table->id();
            $table->string('name',50)->default('')->comment('活动名称');
            $table->string('content',500)->default('')->comment('活动描述');
            $table->timestamp('end_time')->useCurrent()->comment('结束时间');
            $table->timestamp('start_time')->useCurrent()->comment('开始时间');
            $table->tinyInteger('status')->unsigned()->default(0)->comment('0初始 1开启 2进行中');
            $table->timestamps();
        });
        DB::statement('alter table ex_activity comment "活动表"');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity');
    }
}
